<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>VUE3-Mustache语法</title>
  </head>
  <body>
    <div id="app"></div>

    <template id="tpl">
      <div>{{msg}}</div>
      <div>{{msg.split('').reverse().join('')}}</div>
      <div>{{getReversedMsg()}}</div>
    </template>

    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script>
      Vue.createApp({
        template: "#tpl",
        data() {
          return {
            msg: "Hello, 世界",
          };
        },
        methods: {
          getReversedMsg() {
            return this.msg.split("").reverse().join("");
          },
        },
      }).mount("#app");
    </script>
  </body>
</html>
